/**
 * Created by lihao on 15/9/18.
 */

require(['jquery', 'alertify', 'hxz'], function ($, alertify, hxz) {

  $("#index-login-btn").click(function () {
    var username = $("#username").val();
    var password = $("#password").val();
    hxz.doPost({url: "/userLogin", data: {"username": username, "password": password}}, function (data) {
      if (data.status == "1") {
        window.location.href = "/index";
      } else {
        alertify.log("用户名密码错误");
        setTimeout(function () {
          window.location.reload();
        }, 2000)
      }
    });
  })


  $(function () {
    // 执行初始化
  });

});

